<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<title>RobotFramework_Jenkins</title><link href='https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 40px; }
#write.first-line-indent p { text-indent: 2em; }
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
#write.first-line-indent li { margin-left: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
@media screen and (max-width: 500px) {
  body.typora-export { padding-left: 0px; padding-right: 0px; }
  #write { padding-left: 20px; padding-right: 20px; }
  .CodeMirror-sizer { margin-left: 0px !important; }
  .CodeMirror-gutters { display: none !important; }
}
#write li > figure:last-child { margin-bottom: 0.5rem; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; }
button, input, select, textarea { color: inherit; font: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
p { line-height: inherit; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 2; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure > table { margin: 0px !important; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 32px; }
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
.CodeMirror-linenumber { user-select: none; }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
#write pre { white-space: pre-wrap; }
#write.fences-no-line-wrapping pre { white-space: pre; }
#write pre.ty-contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
.md-diagram-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
#write .md-fences.mock-cm { white-space: pre-wrap; }
.md-fences.md-fences-with-lineno { padding-left: 0px; }
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
.CodeMirror-line, twitterwidget { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child, li > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
#write .footnote-line { white-space: pre-wrap; }
@media print {
  body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; }
  #write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; }
  .typora-export * { -webkit-print-color-adjust: exact; }
  html.blink-to-pdf { font-size: 13px; }
  .typora-export #write { padding-left: 32px; padding-right: 32px; padding-bottom: 0px; break-after: avoid; }
  .typora-export #write::after { height: 0px; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
p > .md-image:only-child { display: inline-block; width: 100%; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.md-math-block { width: 100%; }
.md-math-block:not(:empty)::after { display: none; }
[contenteditable="true"]:active, [contenteditable="true"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { text-decoration: underline; }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
  .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  .md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, samp, tt { font-family: var(--monospace); }
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
.md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
code { text-align: left; vertical-align: initial; }
a.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
.md-inline-math .MathJax_SVG .noError { display: none !important; }
.html-for-mac .inline-math-svg .MathJax_SVG { vertical-align: 0.2px; }
.md-math-block .MathJax_SVG_Display { text-align: center; margin: 0px; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; overflow-y: hidden; display: block !important; }
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
.MathJax_SVG .MJX-monospace { font-family: var(--monospace); }
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
.MathJax_SVG { display: inline; font-style: normal; font-weight: 400; line-height: normal; zoom: 90%; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; }
.MathJax_SVG * { transition: none 0s ease 0s; }
.MathJax_SVG_Display svg { vertical-align: middle !important; margin-bottom: 0px !important; margin-top: 0px !important; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg { max-width: 100%; }
[lang="mermaid"] svg, [lang="flow"] svg { max-width: 100%; height: auto; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom: 0px; }
video { max-width: 100%; display: block; margin: 0px auto; }
iframe { max-width: 100%; width: 100%; border: none; }
.highlight td, .highlight tr { border: 0px; }
svg[id^="mermaidChart"] { line-height: 1em; }


.CodeMirror { height: auto; }
.CodeMirror.cm-s-inner { background: inherit; }
.CodeMirror-scroll { overflow: auto hidden; z-index: 3; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
.cm-negative { color: rgb(221, 68, 68); }
.cm-positive { color: rgb(34, 153, 34); }
.cm-header, .cm-strong { font-weight: 700; }
.cm-del { text-decoration: line-through; }
.cm-em { font-style: italic; }
.cm-link { text-decoration: underline; }
.cm-error { color: red; }
.cm-invalidchar { color: red; }
.cm-constant { color: rgb(38, 139, 210); }
.cm-defined { color: rgb(181, 137, 0); }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
.cm-s-inner .CodeMirror-activeline-background { background: inherit; }
.CodeMirror { position: relative; overflow: hidden; }
.CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
.CodeMirror-sizer { position: relative; }
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; }
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: hidden; }
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 30px; z-index: 3; }
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
.CodeMirror-lines { cursor: text; }
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; overflow-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
.CodeMirror-wrap pre { overflow-wrap: break-word; white-space: pre-wrap; word-break: normal; }
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
.CodeMirror-linebackground { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: 0; }
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
.cm-searching { background: rgba(255, 255, 0, 0.4); }
@media print {
  .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
}


:root { --side-bar-bg-color: #fafafa; --control-text-color: #777; }
html { font-size: 16px; }
body { font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(51, 51, 51); line-height: 1.6; }
#write { max-width: 860px; margin: 0px auto; padding: 30px 30px 100px; }
#write > ul:first-child, #write > ol:first-child { margin-top: 30px; }
a { color: rgb(65, 131, 196); }
h1, h2, h3, h4, h5, h6 { position: relative; margin-top: 1rem; margin-bottom: 1rem; font-weight: bold; line-height: 1.4; cursor: text; }
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { text-decoration: none; }
h1 tt, h1 code { font-size: inherit; }
h2 tt, h2 code { font-size: inherit; }
h3 tt, h3 code { font-size: inherit; }
h4 tt, h4 code { font-size: inherit; }
h5 tt, h5 code { font-size: inherit; }
h6 tt, h6 code { font-size: inherit; }
h1 { padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; border-bottom: 1px solid rgb(238, 238, 238); }
h2 { padding-bottom: 0.3em; font-size: 1.75em; line-height: 1.225; border-bottom: 1px solid rgb(238, 238, 238); }
h3 { font-size: 1.5em; line-height: 1.43; }
h4 { font-size: 1.25em; }
h5 { font-size: 1em; }
h6 { font-size: 1em; color: rgb(119, 119, 119); }
p, blockquote, ul, ol, dl, table { margin: 0.8em 0px; }
li > ol, li > ul { margin: 0px; }
hr { height: 2px; padding: 0px; margin: 16px 0px; background-color: rgb(231, 231, 231); border: 0px none; overflow: hidden; box-sizing: content-box; }
li p.first { display: inline-block; }
ul, ol { padding-left: 30px; }
ul:first-child, ol:first-child { margin-top: 0px; }
ul:last-child, ol:last-child { margin-bottom: 0px; }
blockquote { border-left: 4px solid rgb(223, 226, 229); padding: 0px 15px; color: rgb(119, 119, 119); }
blockquote blockquote { padding-right: 0px; }
table { padding: 0px; word-break: initial; }
table tr { border-top: 1px solid rgb(223, 226, 229); margin: 0px; padding: 0px; }
table tr:nth-child(2n), thead { background-color: rgb(248, 248, 248); }
table tr th { font-weight: bold; border-width: 1px 1px 0px; border-top-style: solid; border-right-style: solid; border-left-style: solid; border-top-color: rgb(223, 226, 229); border-right-color: rgb(223, 226, 229); border-left-color: rgb(223, 226, 229); border-image: initial; border-bottom-style: initial; border-bottom-color: initial; margin: 0px; padding: 6px 13px; }
table tr td { border: 1px solid rgb(223, 226, 229); margin: 0px; padding: 6px 13px; }
table tr th:first-child, table tr td:first-child { margin-top: 0px; }
table tr th:last-child, table tr td:last-child { margin-bottom: 0px; }
.CodeMirror-lines { padding-left: 4px; }
.code-tooltip { box-shadow: rgba(0, 28, 36, 0.3) 0px 1px 1px 0px; border-top: 1px solid rgb(238, 242, 242); }
.md-fences, code, tt { border: 1px solid rgb(231, 234, 237); background-color: rgb(248, 248, 248); border-radius: 3px; padding: 2px 4px 0px; font-size: 0.9em; }
code { background-color: rgb(243, 244, 244); padding: 0px 2px; }
.md-fences { margin-bottom: 15px; margin-top: 15px; padding-top: 8px; padding-bottom: 6px; }
.md-task-list-item > input { margin-left: -1.3em; }
@media print {
  html { font-size: 13px; }
  table, pre { break-inside: avoid; }
  pre { overflow-wrap: break-word; }
}
.md-fences { background-color: rgb(248, 248, 248); }
#write pre.md-meta-block { padding: 1rem; font-size: 85%; line-height: 1.45; background-color: rgb(247, 247, 247); border: 0px; border-radius: 3px; color: rgb(119, 119, 119); margin-top: 0px !important; }
.mathjax-block > .code-tooltip { bottom: 0.375rem; }
.md-mathjax-midline { background: rgb(250, 250, 250); }
#write > h3.md-focus::before { left: -1.5625rem; top: 0.375rem; }
#write > h4.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h5.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h6.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
.md-image > .md-meta { border-radius: 3px; padding: 2px 0px 0px 4px; font-size: 0.9em; color: inherit; }
.md-tag { color: rgb(167, 167, 167); opacity: 1; }
.md-toc { margin-top: 20px; padding-bottom: 20px; }
.sidebar-tabs { border-bottom: none; }
#typora-quick-open { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); }
#typora-quick-open-item { background-color: rgb(250, 250, 250); border-color: rgb(254, 254, 254) rgb(229, 229, 229) rgb(229, 229, 229) rgb(238, 238, 238); border-style: solid; border-width: 1px; }
.on-focus-mode blockquote { border-left-color: rgba(85, 85, 85, 0.12); }
header, .context-menu, .megamenu-content, footer { font-family: "Segoe UI", Arial, sans-serif; }
.file-node-content:hover .file-node-icon, .file-node-content:hover .file-node-open-state { visibility: visible; }
.mac-seamless-mode #typora-sidebar { background-color: var(--side-bar-bg-color); }
.md-lang { color: rgb(180, 101, 77); }
.html-for-mac .context-menu { --item-hover-bg-color: #E6F0FE; }
#md-notification .btn { border: 0px; }
.dropdown-menu .divider { border-color: rgb(229, 229, 229); }
.ty-preferences .window-content { background-color: rgb(250, 250, 250); }
.ty-preferences .nav-group-item.active { color: white; background: rgb(153, 153, 153); }

 .typora-export li, .typora-export p, .typora-export,  .footnote-line {white-space: normal;} 
</style>
</head>
<body class='typora-export os-windows' >
<div  id='write'  class = 'is-node'><h1><a name="robotframeworkjenkins" class="md-header-anchor"></a><span>RobotFramework+Jenkins</span></h1><div class='md-toc' mdtype='toc'><p class="md-toc-content" role="list"><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n0"><a class="md-toc-inner" style="cursor: pointer;" href="#robotframeworkjenkins">RobotFramework+Jenkins</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n3"><a class="md-toc-inner" style="cursor: pointer;" href="#初次启动jenkins">初次启动Jenkins</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n4"><a class="md-toc-inner" style="cursor: pointer;" href="#安装jenkins">安装Jenkins</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n9"><a class="md-toc-inner" style="cursor: pointer;" href="#配置jenkins">配置Jenkins</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n14"><a class="md-toc-inner" style="cursor: pointer;" href="#管理节点">管理节点</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n36"><a class="md-toc-inner" style="cursor: pointer;" href="#launch-method">Launch method</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n37"><a class="md-toc-inner" style="cursor: pointer;" href="#launch-slave-via-execution-of-command-on-the-master">Launch slave via execution of command on the Master </a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n39"><a class="md-toc-inner" style="cursor: pointer;" href="#launch-agent-by-connecting-it-to-master">Launch agent by connecting it to master</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n42"><a class="md-toc-inner" style="cursor: pointer;" href="#创建project">创建project</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n43"><a class="md-toc-inner" style="cursor: pointer;" href="#freestyle-project">freestyle project</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n75"><a class="md-toc-inner" style="cursor: pointer;" href="#多配置项目">多配置项目</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n80"><a class="md-toc-inner" style="cursor: pointer;" href="#multijob-project">multijob project</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n82"><a class="md-toc-inner" style="cursor: pointer;" href="#执行project">执行project</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n85"><a class="md-toc-inner" style="cursor: pointer;" href="#与robot-framework集成">与robot framework集成</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n86"><a class="md-toc-inner" style="cursor: pointer;" href="#robot-插件">robot 插件</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n90"><a class="md-toc-inner" style="cursor: pointer;" href="#jenkins-multijob-plugin-插件">jenkins-multijob-plugin 插件</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n92"><a class="md-toc-inner" style="cursor: pointer;" href="#publish-over-ssh-插件">publish-over-ssh 插件</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n95"><a class="md-toc-inner" style="cursor: pointer;" href="#allure-jenkins-plugin-插件">allure-jenkins-plugin 插件</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n97"><a class="md-toc-inner" style="cursor: pointer;" href="#allure框架的使用">allure框架的使用</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n164"><a class="md-toc-inner" style="cursor: pointer;" href="#allure与jenkins的继承">allure与Jenkins的继承</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n107"><a class="md-toc-inner" style="cursor: pointer;" href="#在allure的测试报告中显示截图">在allure的测试报告中显示截图</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n168"><a class="md-toc-inner" style="cursor: pointer;" href="#mailer-plugin-插件">mailer-plugin 插件</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n109"><a class="md-toc-inner" style="cursor: pointer;" href="#subversion-插件">Subversion 插件</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n111"><a class="md-toc-inner" style="cursor: pointer;" href="#执行机目录规划">执行机目录规划</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n151"><a class="md-toc-inner" style="cursor: pointer;" href="#jenkins-project规划">Jenkins project规划</a></span></p></div><h2><a name="初次启动jenkins" class="md-header-anchor"></a><span>初次启动Jenkins</span></h2><h3><a name="安装jenkins" class="md-header-anchor"></a><span>安装Jenkins</span></h3><p><span>使用tomcat+Jenkins.war的形式安装，环境使用Ubuntu。</span><br/><span>首先下载Oracle JDK的二进制包，解压后移动到/opt目录（</span><strong><span>不要将移动到/opt目录下的文件或目录的所有者变成root，这样以后修改文件会很麻烦的</span></strong><span>），在~/.bashrc中添加环境变量</span></p><pre spellcheck="false" class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 36px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 28px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -28px; width: 28px;"></div><div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -28px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 19px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">export JAVA_HOME=/opt/jdk-13</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -28px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 19px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">export PATH=${JAVA_HOME}/bin:${PATH}</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 46px;"></div><div class="CodeMirror-gutters" style="height: 46px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 27px;"></div></div></div></div></pre><p><span>为了避免可能的兼容性问题，不要去使用openJDK。使用二进制包而不是deb包，是为了方便，解压即可，也没什么依赖问题。</span></p><p><span>解压tomcat二进制包到/opt目录，并将Jenkins.war放到tomcat/webapps目录下。需要安装</span><code>sudo apt install fontconfig</code><span>，否则运行Jenkins会报错，java.lang.NullPointerException at sun.awt.FontConfiguration.getVersion。</span><br/><span>运行tomcat/bin/startup.sh启动Jenkins。</span></p><h3><a name="配置jenkins" class="md-header-anchor"></a><span>配置Jenkins</span></h3><p><span>首次打开Jenkins网页前要断网，因为它会检查一些推荐的插件，但是插件网站被墙了，所以检查的时间非常慢。断网后选择跳过安装推荐的插件，然后进入Jenkins中，在 manage Jenkins -&gt; manage plugin -&gt; advanced 中，将update site修改为</span><code>https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json</code><span>。可惜这只能加速插件列表的读取速度，插件的下载速度依旧很慢。</span></p><p><span>无法下载插件的话，可以在</span><code>http://updates.jenkins-ci.org/download/plugins/</code><span>中手动下载插件安装包，然后在 manage Jenkins -&gt; manage plugin 中上传并安装。</span></p><p><span>在 manage Jenkins -&gt; configure system -&gt; Jenkins URL 中设置URL，使用实际的IP或域名代替localhost，比如</span><code>http://192.168.1.128:8080/jenkins/</code></p><p><strong><span>Jenkins对中文支持不好，界面也不能做到完全汉化，所以不管时Jenkins的界面，还是上面的配置，能用英文就用英文</span></strong><span>。</span></p><h2><a name="管理节点" class="md-header-anchor"></a><span>管理节点</span></h2><p><span>运行Jenkins服务的机器叫做master，连接到master并执行任务的机器叫做agent，不管是master还是agent都是node，都可以执行任务。</span></p><p><span>安装完Jenkins后就会有一台执行机（就是master），然后根据需要添加跟多的执行机。manage Jenkins -&gt; manage nodes -&gt; new node，创建agent时有如下配置需要注意</span></p><figure><table><thead><tr><th><span>菜单</span></th><th><span>说明</span></th></tr></thead><tbody><tr><td><span>#</span><span> of executors</span></td><td><span>node上能并发执行的任务数量</span></td></tr><tr><td><span>Remote root directory</span></td><td><span>node上Jenkins的主目录，master的是～/.jenkins</span></td></tr><tr><td><span>Labels</span></td><td><span>多个label用空格分隔</span></td></tr><tr><td><span>Launch method</span></td><td><span>agent的启动方式</span></td></tr><tr><td><span>Environment variables</span></td><td><span>如果node中有同名的环境变量，则替换它</span></td></tr></tbody></table></figure><h3><a name="launch-method" class="md-header-anchor"></a><span>Launch method</span></h3><h4><a name="launch-slave-via-execution-of-command-on-the-master" class="md-header-anchor"></a><span>Launch slave via execution of command on the Master </span></h4><p><span>在master上使用ssh或其他什么的命令连接agent，然后启动agent上的agent.jar使得agent连接master，或者使用docker在master上再起一个agent。一般不会直接写一个命令，而是在master上写一个脚本，然后Jenkins执行这个脚本，优点是当agent特别多的时候，可以使用master上的脚本统一管理，缺点是脚本要自己写。</span></p><h4><a name="launch-agent-by-connecting-it-to-master" class="md-header-anchor"></a><span>Launch agent by connecting it to master</span></h4><p><span>要使用该连接方式需要先开启 manage Jenkins -&gt; Configure Global Security -&gt; TCP port for inbound agents，选择random。在agent protocols中勾选Inbound TCP Agent Protocol/3 (deprecated, basic encryption)</span></p><p><span>这种方式是手动在agent上启动agent.jar来连接master，它默认会在remote root directory/remoting 中保存一些缓存和log。</span></p><h2><a name="创建project" class="md-header-anchor"></a><span>创建project</span></h2><h3><a name="freestyle-project" class="md-header-anchor"></a><span>freestyle project</span></h3><figure><table><thead><tr><th><span>菜单</span></th><th><span>说明</span></th></tr></thead><tbody><tr><td><span>Discard old builds</span></td><td><span>多久之前的执行结果会被丢弃</span></td></tr><tr><td><span>This project is parameterized</span></td><td><span>设置project执行的一些参数，每次执行project时都需要用户手动输入这些参数的值，即使原先已经设置了默认值。该功能适用于手动执行project的情况</span></td></tr><tr><td><span>Execute concurrent builds if necessary</span></td><td><span>多次触发同一个project的build，这些build会排队执行，勾选该选项后，只要有空闲的agent，就能并发build同一个project</span></td></tr><tr><td><span>Restrict where this project can be run</span></td><td><span>指定该project能跑在哪个agent上，指定的方式是label</span></td></tr><tr><td><span>general-&gt;advanced-&gt;Use custom workspace</span></td><td><span>指定project的work directory，默认是</span><code>root directory/workspace/&lt;project name&gt;</code></td></tr><tr><td><span>Build after other projects are built</span></td><td><span>多个project串联build时可以用</span></td></tr><tr><td><span>Build periodically</span></td><td><span>周期任务，语法同Linux的crontab</span></td></tr><tr><td><span>add build step</span></td><td><span>最简单的比如Linux shell或Windows批处理命令，此处可以使用系统变量或者是Jenkins中设置的环境变量和参数</span></td></tr><tr><td><span>add prost-build action</span></td><td><span>其中的build other projects和前面的Build after other projects are built是一对</span></td></tr></tbody></table></figure><h3><a name="多配置项目" class="md-header-anchor"></a><span>多配置项目</span></h3><p><span>比如在build中添加的执行步骤是一个shell命令，该命令接受一个参数，我现在希望该参数的值传入1，跑一次项目，然后再传入2，跑一次项目，那就可以使用这个多配置项目。</span><br/><span>多配置项目会将不同的参数组合，在某一个可用的节点上都跑一次，如果该执行机上有多个 executor，则并发执行，也可手动设置为顺序执行。</span></p><p><span>还可以勾选多个节点，让同一个项目在多个节点上并发执行。那如果我既配置了参数，又勾选了多个节点呢？那就在每个节点上，把多种参数的项目都跑一边，即一个节点需要跑多个项目。</span></p><p><span>多配置项目的执行效果是，在某个节点上执行多配置项目，build之前的配置，比如Source Code Management，都跑在该节点上，之后如果有多个节点要build，则在这些节点上触发build和Post-build Actions。</span><br/><span>所以如果希望每个节点在build之前先拉去代码，则不能使用多配置项目中的Source Code Management，可以在build中使用命令行。</span></p><p><span>只有build会占用executors，如果多配置项目在master上执行，它不会占用master中的executors，除非它在master上触发了build。</span></p><h3><a name="multijob-project" class="md-header-anchor"></a><span>multijob project</span></h3><p><span>自由的串联并联执行多个已经存在的project。</span></p><h3><a name="执行project" class="md-header-anchor"></a><span>执行project</span></h3><p><span>参数：project中可以配置参数，另外在node中可以配置node级别的环境变量，在configure system中可以配置全局的环境变量。</span></p><p><span>执行：roject的build会被分配到指定label的空闲node上，同一个project只会在一个node上build一次。</span></p><h2><a name="与robot-framework集成" class="md-header-anchor"></a><span>与robot framework集成</span></h2><h3><a name="robot-插件" class="md-header-anchor"></a><span>robot 插件</span></h3><p><span>在Jenkins中展示测试报告。</span><br/><span>在需要的project中的post-build actions中添加publish robot framework test result。</span><br/><span>该插件以来几个可选的插件，虽说是【可选】，但必须要安装，否则该插件不能用。</span><br/><span>插件的依赖关系在</span><code>https://plugins.jenkins.io/</code><span>中可以查到。</span></p><p><span>打开robot的测试报告可能会遇到</span><code>opening robot framework log failed</code><span>。</span></p><p><span>不要自定义RF输出的log或xml文件的名字，虽然robot插件可以为这些文件指定自定义的名字，也可以顺利获取到这些文件，但却不能展示到Jenkins的页面中，这是一个bug。</span></p><h3><a name="jenkins-multijob-plugin-插件" class="md-header-anchor"></a><span>jenkins-multijob-plugin 插件</span></h3><p><span>串联并联build多个project。</span></p><h3><a name="publish-over-ssh-插件" class="md-header-anchor"></a><span>publish-over-ssh 插件</span></h3><p><span>可以在build或Post-build Actions阶段，将文件上传到FTP服务器，但是不能将FTP服务器中的文件下载到本地。</span></p><p><span>在project的build &gt; Send files over FTP &gt; advanced中勾选Flatten files，只上传文件，不创建目录；勾选Clean remote，上传之前先清空FTP上远程目录中的文件。</span></p><h3><a name="allure-jenkins-plugin-插件" class="md-header-anchor"></a><span>allure-jenkins-plugin 插件</span></h3><p><span>Allure Report是一个测试报告框架，和robot framework、Jenkins等都能集成，用处就是生成好看的测试报告。</span></p><h4><a name="allure框架的使用" class="md-header-anchor"></a><span>allure框架的使用</span></h4><p><span>Allure Framework在各平台的安装方式见</span><a href=' https://docs.qameta.io/allure/#_installing_a_commandline'><span>官方文档</span></a><span>，allure与RF的继承方式是安装python模块</span><code>pip install allure-robotframework</code><span>。</span></p><p><span>使用方式是</span><code>robot --listener allure_robotframework ./my_robot_test</code><span>，allure会在cmd的当前目录中生成output/allure文件夹，用来存放输出的文件。robot自己的output文件也还是会输出，除非手动禁止。</span><code>robot --listener allure_robotframework;/set/your/path/here ./my_robot_test</code><span>这样可以指定allure文件的输出目录。</span></p><p><span>现在allure只是生成了数据文件，并不是测试报告，生成测试报告需要使用：</span><br/><code>allure generate &lt;数据文件所在目录，多个目录就可以合并多个结果&gt; -c -o &lt;测试报告输出的目录&gt;</code><span>：-c 表示在输出测试报告前先清空测试报告的目录。</span><br/><code>allure open &lt;测试报告输出的目录&gt;</code><span>：启动一个http服务，打开浏览器，使用这个http服务查看测试报告。allure生成的测试报告不能直接在本地查看，要用到http服务。</span><br/><code>allure serve &lt;数据文件所在目录&gt;</code><span>：这是前两个命令的组合，它会在系统的临时目录中生成测试报告，并启动http服务，然后用浏览器打开测试报告。</span></p><h4><a name="allure与jenkins的继承" class="md-header-anchor"></a><span>allure与Jenkins的继承</span></h4><p><span>在Jenkins中安装allure-jenkins-plugin后，在Jenkins的global tool configuration的Allure Commandline中配置：</span></p><p><img src="./images/RobotFramework+Jenkins_37ea873b985043e2ea8a130d8d711dd5.png" referrerpolicy="no-referrer" alt="RobotFramework+Jenkins_37ea873b985043e2ea8a130d8d711dd5"></p><p><span>【name】随意，不要勾选【Install automatically】，因为我前面已经安装了allure了。</span></p><p><span>在project的post-build actions中添加：</span></p><p><img src="./images/RobotFramework+Jenkins_0157f604166a62150f5de7adaee70060.png" referrerpolicy="no-referrer" alt="RobotFramework+Jenkins_0157f604166a62150f5de7adaee70060"></p><p><span>【results】指的是allure输出的数据文件，这个路径是需要手动配置的，它是project的workspace下的相对路径。</span><br/><span>【repot path】是测试报告的生成路径，默认值是allure-report，即默认allure-jenkins-plugin会自动在project的workspace下allure-report中生成测试报告。点击此处可查看测试报告</span></p><p><img src="./images/RobotFramework+Jenkins_dc2d25dcd11c4865429e4bc96e22772b.png" referrerpolicy="no-referrer" alt="RobotFramework+Jenkins_dc2d25dcd11c4865429e4bc96e22772b"></p><h4><a name="在allure的测试报告中显示截图" class="md-header-anchor"></a><span>在allure的测试报告中显示截图</span></h4><p><span>截图的显示，尤其是当allure与Jenkins集成时，需要自己写一个截屏函数。在PageObject中添加一个函数：</span></p><pre lang="python" class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded md-focus" spellcheck="false" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap CodeMirror-focused" lang="python"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 529px; left: 495.125px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 36px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre>x</pre><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>14</div></div><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>8</div></div><div class="CodeMirror-linenumber CodeMirror-gutter-elt"><div>15</div></div></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div style="position: relative;" class=""><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 27px;">1</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">from</span> <span class="cm-variable">robot</span>.<span class="cm-property">api</span> <span class="cm-keyword">import</span> <span class="cm-variable">logger</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">2</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre></div><div class="" style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">3</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment"># 这个作为PageObject类的一个方法</span></span></pre></div><div class="" style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">4</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">def</span> <span class="cm-def">screenshot_for_allure</span>(<span class="cm-variable-2">self</span>):</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">5</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-comment"># python中的一种写法，这些模块只在该方法中使用，那我就只在该方法中导入</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">6</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-comment"># 该方法执行完毕后，这些导入的模块也就失效了，不能再被使用</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">7</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">from</span> <span class="cm-variable">allure</span> <span class="cm-keyword">import</span> <span class="cm-variable">attach</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">8</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">from</span> <span class="cm-variable">allure_commons</span>.<span class="cm-property">types</span> <span class="cm-keyword">import</span> <span class="cm-variable">AttachmentType</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">9</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-comment"># 截屏代码参考seleniumlibrary，主要修改两点：</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 27px;">10</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-comment"># 1 截屏路径直接写死，seleniumlibrary的生成截屏路径的方法没那么容易被调用，而且截图最终被复制到allure中，这个截屏路径只是个临时存放地点，写死即可</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">11</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-comment"># 2 修改打印的log，原来是用log在report中插入HTML代码来展示截屏，修改为只打印截图的名字。</span></span></pre></div><div class="" style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">12</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-comment"># 因为allure添加附件时设置的名字时附件在html页面中展示的名字，而不是真实的文件名，真实的文件名是自动生成的。故我不能在report中插入html代码，让其指向真实的文件地址。只能打印个名字，让用户自己去找。</span></span></pre></div><div class="" style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">13</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">if</span> <span class="cm-keyword">not</span> <span class="cm-variable-2">self</span>.<span class="cm-property">selib</span>.<span class="cm-property">_drivers</span>.<span class="cm-property">current</span>:</span></pre></div><div style="position: relative;" class=""><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">14</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-variable">logger</span>.<span class="cm-property">info</span>(<span class="cm-string">'Cannot capture screenshot because no browser is open.'</span>)</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">15</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-keyword">return</span></span></pre></div><div style="position: relative;" class=""><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">16</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">png_name</span>=<span class="cm-builtin">str</span>(<span class="cm-builtin">int</span>(<span class="cm-variable">time</span>()))<span class="cm-operator">+</span><span class="cm-string">'.png'</span></span></pre></div><div style="position: relative;" class=""><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">17</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">png_path</span>=<span class="cm-variable">SCREENSHOT_DIR</span><span class="cm-operator">+</span><span class="cm-string">'\\'</span><span class="cm-operator">+</span><span class="cm-variable">png_name</span></span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">18</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">if</span> <span class="cm-keyword">not</span> <span class="cm-variable-2">self</span>.<span class="cm-property">selib</span>.<span class="cm-property">driver</span>.<span class="cm-property">save_screenshot</span>(<span class="cm-variable">png_path</span>):</span></pre></div><div style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">19</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-keyword">raise</span> <span class="cm-variable">RuntimeError</span>(<span class="cm-string">"Failed to save screenshot '{}'."</span>.<span class="cm-property">format</span>(<span class="cm-variable">png_path</span>))</span></pre></div><div class="" style="position: relative;"><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">20</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" class="cm-tab-wrap-hack" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span></span></pre></div><div style="position: relative;" class=""><div class="CodeMirror-gutter-wrapper" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 0px; width: 27px;">21</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">attach</span>.<span class="cm-property">file</span>(<span class="cm-variable">png_path</span>, <span class="cm-variable">name</span>=<span class="cm-variable">png_name</span>, <span class="cm-variable">attachment_type</span>=<span class="cm-variable">AttachmentType</span>.<span class="cm-property">PNG</span>)</span></pre></div><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -36px; width: 36px;"></div><div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -36px;"><div class="CodeMirror-linenumber CodeMirror-gutter-elt CodeMirror-linenumber-show" style="left: 0px; width: 27px;">22</div></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">logger</span>.<span class="cm-property">info</span>(<span class="cm-string">'&lt;screenshot_for_allure&gt; '</span><span class="cm-operator">+</span><span class="cm-variable">png_name</span>)</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 552px;"></div><div class="CodeMirror-gutters" style="height: 552px;"><div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 35px;"></div></div></div></div></pre><p>&nbsp;</p><h3><a name="mailer-plugin-插件" class="md-header-anchor"></a><span>mailer-plugin 插件</span></h3><p>&nbsp;</p><h3><a name="subversion-插件" class="md-header-anchor"></a><span>Subversion 插件</span></h3><p><span>代码拉取后会放在project的workspace中，如果希望多个project使用同一套代码，则需要为多个project配置Use custom workspace</span></p><h2><a name="执行机目录规划" class="md-header-anchor"></a><span>执行机目录规划</span></h2><figure><table><thead><tr><th><span>Jenkins目录</span></th><th><span>作用</span></th><th><span>说明</span></th></tr></thead><tbody><tr><td><span>D:\jenkins</span></td><td><span>作为Remote root directory</span></td><td><span>每台执行机都要创建D盘，且D盘是最有一个分区，方便空间不够时扩容</span></td></tr><tr><td><span>D:\jenkins\remoting</span></td><td><span>Jenkins存储log等文件</span></td><td><span>Jenkins自动创建</span></td></tr><tr><td><span>D:\jenkins\workspace</span></td><td><span>每个project默认都会在该目录下创建自己的工作目录</span></td><td><span>Jenkins自动创建</span></td></tr><tr><td><span>D:\jenkins\project</span></td><td><span>代码、测试数据、测试资源等</span></td><td><span>即所有需要上传到版本库中的文件</span></td></tr><tr><td><span>D:\jenkins\project\autoIt</span></td><td><span>autoIt脚本和编译后的exe</span></td><td>&nbsp;</td></tr><tr><td><span>D:\jenkins\project\robot</span></td><td><span>robot工程代码</span></td><td><span>用pycharm打开的就是这个目录</span></td></tr><tr><td><span>D:\jenkins\tmp</span></td><td>&nbsp;</td><td><span>需要下载的待测试软件的安装升级包，或者其他临时数据</span></td></tr><tr><td><span>D:\jenkins\tool</span></td><td>&nbsp;</td><td><span>和测试用例无关，但是会用到的绿色软件或脚本，比如下载安装包用的curl</span></td></tr></tbody></table></figure><p><code>D:\jenkins\project\robot</code><span> 该目录结构同《RobotFramework工程结构》，但还需要加几个文件。</span></p><p><code>D:\jenkins\project\robot\args\</code><span>：存放robot -A参数需要的argumentfile。</span><br/><code>D:\jenkins\project\robot\node_vars.py</code><span>：《RobotFramework工程结构》中的project_vars.py是robot -V参数需要的variablefile，但是因为每个节点都需要一些自定义的变量，所以再加一个node_vars.py，它</span><code>form project_vars.py import *</code><span>，并给一些需要自定义的变量重新赋值。</span></p><h2><a name="jenkins-project规划" class="md-header-anchor"></a><span>Jenkins project规划</span></h2><p><span>依据实际项目而定，这里不再记录。只说几个要点。</span></p><ol start='' ><li><span>需要安装svn的命令行版本，方便再build中自由拉去代码，而不是被Jenkins project中的Source Code Management限制</span></li><li><span>安装curl，因为publish-over-ssh插件只能用来上传，不能下载</span></li><li><span>安装WinRAR，使用命令行压缩/解压文件</span></li></ol></div>
</body>
</html>